package list;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Vector;

/**
 * @Classname TestList2
 * @Description TODO
 * @Date 2021/5/16 22:39
 * @Created by 张斌
 */
public class TestList2 {
    public static void main(String[] args) {
//        transArray();
        testVector();
    }

    public static void transArray() {
        List<String> list1 =new ArrayList<String> ();
        list1.add("zhangsna");
        list1.add("lisi");
        list1.add("wangwu");
        list1.add("zhaoiu");
        String[] str=new String[list1.size()+2];
        list1.toArray(str);
        System.out.println(Arrays.toString(str));
        List<String> list2 = Arrays.asList(str);
        System.out.println(Arrays.binarySearch(str,"lis"));
        System.out.println(Arrays.binarySearch(str,"riant"));
        str[4]="riant";
        str[5]="riant1";
        System.out.println(Arrays.toString(str));
        Arrays.sort(str);
        System.out.println(Arrays.toString(str));
        System.out.println(Arrays.binarySearch(str,"lis"));
        //str[5]="riant01";
//        System.out.println(list2.size());
//        System.out.println(str.length);
    }

    public static void testVector() {
        Vector<String> vector=new Vector<String> ();
        vector.add("lisi");
        vector.add("wuwu");
        vector.add("wuwu");
        vector.add("wuwu");
        System.out.println(vector.size());
    }

}
